package com.xxwu.springiocdi.Component;

import com.xxwu.springiocdi.dao.User;
import lombok.Data;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

@Component
@Data
public class BeanConfig {
    @Bean(name = {"u1","user1"}) //为Bean对象重命名
    public User user() {
        User user = new User();
        user.setUserName("xxwu");
        user.setPassword("1123");
        return user;
    }
    @Bean
    public User user2() {
        User user = new User();
        user.setUserName("xxwu");
        user.setPassword("1123");
        return user;
    }
}
